<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    header {
      width: 375px;
      height: 60px;
      background-color: lightcoral;
      color: white;
      font-size: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
    }
    span {
      position: absolute;
      right: 20px;
      top: 50%;
      transform: translateY(-50%);
    }
  </style>
</head>
<body>
  <div id="app">
    <h2>猫眼头部</h2>
    <my-header title="猫眼头部">
      <span>🏀</span>
    </my-header>
    <br>
    <my-header title="详情页"></my-header>

  </div>

  <script src="../vue3.js"></script>
  <script>
    const {createApp} = Vue;

    const MyHeader = {
      props: ["title"],
      template: `
        <header>{{ title }} <slot></slot></header>
      `
    }

    const app = createApp({
      components: {
        MyHeader,
      }
    });

    app.mount("#app");
  </script>
</body>
</html>